#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>


int cmp(const int* p1, const int* p2)
{
    return (*p1 - *p2);

}

int missingNumber(int* nums, int numsSize) {
    qsort(nums, numsSize, sizeof(int), cmp);
    for (int i = 0; i < numsSize - 1; i++)
    {
        if (nums[i + 1] - nums[i] > 1)
        {
            return nums[i] + 1;
        }
    }
}

int main()
{
    int nums[10] = { 3,5,4,1,6,2,8,10,9,11};
    int ret = missingNumber(nums, 10);
    printf("%d\n", ret);

	return 0;
}